gsize text_len;
gboolean strip_ulines;
GString *text_data;
+ gunichar accel_key;
} UriParserData;
static char *
-strip_ulines (const char *text)
+strip_ulines (const char *text,
+ guint *accel_key)
{
char *new_text;
const char *p;
}
*q = *p;
+ if (after_uline && *accel_key == 0)
+ *accel_key = g_utf8_get_char (p);
+
q++;
after_uline = FALSE;
}
if (pdata->strip_ulines && strchr (pdata->text_data->str, '_'))
{
- text = strip_ulines (pdata->text_data->str);
+ text = strip_ulines (pdata->text_data->str, &pdata->accel_key);
text_len = strlen (text);
}
else
parse_uri_markup (GtkLabel *self,
const char *str,
gboolean strip_ulines,
+ gunichar *accel_key,
char **new_str,
GtkLabelLink **links,
guint *out_n_links,
pdata.text_len = 0;
pdata.strip_ulines = strip_ulines;
pdata.text_data = g_string_new ("");
+ pdata.accel_key = 0;
while (p != end && xml_isspace (*p))
p++;
*links = NULL;
}
+ if (accel_key)
+ *accel_key = pdata.accel_key;
+
return TRUE;
failed:
char *str_for_display = NULL;
GtkLabelLink *links = NULL;
guint n_links = 0;
- guint accel_keyval = 0;
+ gunichar accel_keyval = 0;
gboolean do_mnemonics;
do_mnemonics = self->mnemonics_visible &&
if (!parse_uri_markup (self, str,
with_uline && !do_mnemonics,
+ &accel_keyval,
&str_for_display,
&links, &n_links,
&error))